package cc.forgemod.customicon.client.texture;

import cc.forgemod.customicon.client.ResourceListener;
import net.minecraft.client.renderer.block.model.IBakedModel;

public class TextureCIItem extends ATextureCIItem {

    /** 主BakedModel */
    protected IBakedModel mBakedModel = null;;

    /**
     * 在自己写的ItemRender调用getItemModelWithOverrides时调用
     * 
     * @param pModel
     *            父Model
     * @return 替换的Model
     */
    public IBakedModel getItemModelWithOverrides(IBakedModel pModel) {
        return pModel;
    }

    /**
     * 在字段{@link #mCacheImage}更新时调用,用于更新原版FrameData数据与GL材质
     */
    protected void onImageUpdate() {
        super.onImageUpdate();

        this.mBakedModel = ResourceListener.bakeTexture(this);
    }

    public IBakedModel getBakedModel() {
        return this.mBakedModel;
    }

}
